
// <copyright file="StringHelperTests.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The string helper tests.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Tests
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// The string helper tests.
    /// </summary>
    [TestClass]
    public class StringHelperTests
    {
        #region Public Methods and Operators

        /// <summary>
        /// The mutable asign test.
        /// </summary>
        [TestMethod]
        public void MutableAsignTest()
        {
            const string s = "Hello";
            s.MutableAssign("Subra");
            Assert.AreEqual(s, "Subra");
        }

        /// <summary>
        /// The mutable replace test.
        /// </summary>
        [TestMethod]
        public void MutableReplaceTest()
        {
            const string s = "Hello. How are you?. Where are you?";
            s.MutableReplace("are", "era");
            Assert.AreEqual(s, "Hello. How era you?. Where era you?");

            s.MutableReplace("o", "x");
            Assert.AreEqual(s, "Hellx. Hxw era yxu?. Where era yxu?");
        }

        /// <summary>
        /// The mutable reverse test.
        /// </summary>
        [TestMethod]
        public void MutableReverseTest()
        {
            const string s = "Hello";
            StringHelper.MutableReverse(s);
            Assert.AreEqual(s, "olleH");
        }

        /// <summary>
        /// The mutable to lower test.
        /// </summary>
        [TestMethod]
        public void MutableToLowerTest()
        {
            const string s = "HELLO";
            s.MutableToLower();
            Assert.AreEqual(s, "hello");
        }

        /// <summary>
        /// The mutable to upper test.
        /// </summary>
        [TestMethod]
        public void MutableToUpperTest()
        {
            const string s = "Hello";
            s.MutableToUpper();
            Assert.AreEqual(s, "HELLO");
        }

        #endregion Public Methods and Operators
    }
}